package rmmk.algorithms.similarityMeasures.abstraction;

import java.util.HashMap;

import rmmk.framework.datasources.Document;

/**
 * Klasa abstrakcyjnej miary podobienstwa
 *
 */
public abstract class AbstractSimilarityMeasure{
	private static HashMap<Document, Double[]> cache = new HashMap<>();
	
	public Double[] calculate(Document input, Document document){
		if(cache.containsKey(document))
			return cache.get(document);
		else{
			Double[] resp = doCalculate(input,document);
			cache.put(document, resp);
			return resp;
		}
	}
	
	public abstract Double[] doCalculate(Document input, Document document);
	public abstract int getSimilarityMeasureSize();
}
